package nuc.edu.dao;

import nuc.edu.entities.User;
import nuc.edu.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by 张朝亮
 */
@Repository
public class UserDao {

    @Autowired
    private UserMapper usermapper;

    public User userLogin(String username,String password){
        User user = usermapper.getUserByUserName(username);
        if(user != null && user.getPassword().equals(password))
            return user;
        else
            return null;
    }
}
